﻿<Window x:Class="PhpDocBlockGenerator.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
        xmlns:command="clr-namespace:GalaSoft.MvvmLight.Command;assembly=GalaSoft.MvvmLight.Extras.WPF4"
        Title="Php DocBlock Generator" Height="380" Width="384"
        DataContext="{Binding Main, Source={StaticResource Locator}}" ResizeMode="CanMinimize" Name="Window">
    <i:Interaction.Triggers>
        <i:EventTrigger EventName="Closing">
            <command:EventToCommand Command="{Binding WindowClosingCommand}" />
        </i:EventTrigger>
    </i:Interaction.Triggers>
    <Grid IsEnabled="{Binding Options.IsIdle}">
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="245" />
            <ColumnDefinition Width="*" />
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition Height="25" />
            <RowDefinition Height="25" />
            <RowDefinition Height="25" />
            <RowDefinition Height="25" />
            <RowDefinition Height="25" />
            <RowDefinition Height="25" />
            <RowDefinition Height="25" />
            <RowDefinition Height="25" />
            <RowDefinition Height="25" />
            <RowDefinition Height="25" />
            <RowDefinition Height="25" />
            <RowDefinition Height="25" />
            <RowDefinition Height="35" />
        </Grid.RowDefinitions>
        <!-- Source -->
        <Label Grid.Column="0" Grid.ColumnSpan="2" Grid.Row="0" Content="Quell-Pfad" Height="23" HorizontalAlignment="Left" VerticalAlignment="Bottom" />
        <TextBox Grid.Column="0" Grid.Row="1" Height="23" HorizontalAlignment="Stretch" VerticalAlignment="Top" Margin="10,0" Text="{Binding Options.SourcePath, Mode=TwoWay}"/>
        <Button Grid.Column="1" Grid.Row="1" Content="Ordner auswählen" Height="23" HorizontalAlignment="Stretch" VerticalAlignment="Top" Margin="10,0" Command="{Binding SelectSourceFolderCommand}"/>
        
        <!-- Target -->
        <Label Grid.Column="0" Grid.ColumnSpan="2" Grid.Row="2" Content="Ziel-Pfad" Height="23" HorizontalAlignment="Left" VerticalAlignment="Bottom" />
        <TextBox Grid.Column="0" Grid.Row="3" Height="23" HorizontalAlignment="Stretch" VerticalAlignment="Top" Margin="10,0" Text="{Binding Options.TargetPath, Mode=TwoWay}" IsEnabled="{Binding ElementName=OverwriteFilesCheckBox, Path=IsChecked}"/>
        <Button Grid.Column="1" Grid.Row="3" Content="Ordner auswählen" Height="23" HorizontalAlignment="Stretch" VerticalAlignment="Top" Margin="10,0" Command="{Binding SelectTargetFolderCommand}" IsEnabled="{Binding ElementName=OverwriteFilesCheckBox, Path=IsChecked}" />
        <Label Grid.Column="0" Grid.Row="4" Content="Dateien in neuen Ordner schreiben" />
        <CheckBox Grid.Column="1" Grid.Row="4" HorizontalAlignment="Center" VerticalAlignment="Center" Name="OverwriteFilesCheckBox" IsChecked="{Binding Options.WriteToNewFolder}"/>

        <!-- PhpExe -->
        <Label Grid.Column="0" Grid.ColumnSpan="2" Grid.Row="5" Content="Pfad zur Php.exe" Height="23" HorizontalAlignment="Left" VerticalAlignment="Bottom" />
        <TextBox Grid.Column="0" Grid.Row="6" Height="23" HorizontalAlignment="Stretch" VerticalAlignment="Top" Margin="10,0" Text="{Binding Options.PhpPath, Mode=TwoWay}" IsEnabled="{Binding ElementName=ValidateWithPhpCheckBox, Path=IsChecked}"/>
        <Button Grid.Column="1" Grid.Row="6" Content="Ordner auswählen" Height="23" HorizontalAlignment="Stretch" VerticalAlignment="Top" Margin="10,0" Command="{Binding SelectPhpExeCommand}" IsEnabled="{Binding ElementName=ValidateWithPhpCheckBox, Path=IsChecked}" />
        <Label Grid.Column="0" Grid.Row="7" Content="Dateien mit Php validieren" />
        <CheckBox Grid.Column="1" Grid.Row="7" HorizontalAlignment="Center" VerticalAlignment="Center" Name="ValidateWithPhpCheckBox" IsChecked="{Binding Options.ValidateWithPhp}"/>
        
        <!-- Depth -->
        <Label Grid.Column="0" Grid.Row="8" Content="Tiefe der durchlaufenen Ordnerstruktur" Height="23" HorizontalAlignment="Left" VerticalAlignment="Bottom" />
        <TextBox Grid.Column="1" Grid.Row="8" Height="23" HorizontalAlignment="Stretch" VerticalAlignment="Top" Margin="10,0" Text="{Binding Options.Depth, Mode=TwoWay}" />
        
        <!-- RootName -->
        <Label Grid.Column="0" Grid.Row="9" Content="Name des Rootpaketes" Height="23" HorizontalAlignment="Left" VerticalAlignment="Bottom" />
        <TextBox Grid.Column="1" Grid.Row="9" Height="23" HorizontalAlignment="Stretch" VerticalAlignment="Top" Margin="10,0" Text="{Binding Options.RootNode, Mode=TwoWay}" />
        
        <!-- Number of Columns -->
        <Label Grid.Column="0" Grid.Row="10" Content="Maximale Zeilenlänge vorhanden?" Height="23" HorizontalAlignment="Left" VerticalAlignment="Bottom" />
        <CheckBox Grid.Column="1" Grid.Row="10" HorizontalAlignment="Center" VerticalAlignment="Center" Name="MaxColumnNumberEnabledCheckBox" IsChecked="{Binding Options.IsMaxColumnNumberUsed, Mode=TwoWay}"/>
        <Label Grid.Column="0" Grid.Row="11" Content="Maximale Zeilenlänge" Height="23" HorizontalAlignment="Left" VerticalAlignment="Bottom" />
        <TextBox Grid.Column="1" Grid.Row="11" Height="23" HorizontalAlignment="Stretch" VerticalAlignment="Top" Margin="10,0" Text="{Binding Options.MaxColumnNumber, Mode=TwoWay}" IsEnabled="{Binding ElementName=MaxColumnNumberEnabledCheckBox, Path=IsChecked}"/>
        
        <!-- Go -->
        <Grid Grid.Column="0" Grid.Row="12" Margin="5,0,0,0">
            <Grid.RowDefinitions>
                <RowDefinition Height="*" />
                <RowDefinition Height="15" />
            </Grid.RowDefinitions>
            
            <ProgressBar Grid.Row="1" FlowDirection="LeftToRight" Value="{Binding Options.CurrentProgress}"/>
        </Grid>
        <Button Grid.Column="1" Grid.Row="12" Content="Go!" Height="23" HorizontalAlignment="Stretch" VerticalAlignment="Bottom" Margin="10,0" Command="{Binding StartCommand}" />
    </Grid>
</Window>
